package cn.wzptsoft.tinymallbe.service;

import cn.wzptsoft.tinymallbe.entity.Poster;
import cn.wzptsoft.tinymallbe.repository.PosterRepository;
import org.springframework.stereotype.Service;

@Service
public class PosterService {

    private final PosterRepository posterRepository;

    public PosterService(PosterRepository posterRepository) {
        this.posterRepository = posterRepository;
    }

    /**
     * 查找指定的广告
     *
     * @param name 广告的名称
     * @return Poster
     */
    public Poster getByName(String name) {
        return posterRepository.findByName(name);
    }
}
